package com.wei.demo11;

import java.util.Arrays;
import java.util.Random;
import java.util.stream.IntStream;

/**
 * @author cosmoswei
 */
public class Java8StreamDemo {
    public static void main(String[] args) {
        int[] iArr = {1, 2, 3, 4, 5, 6, 7};


        System.out.println(System.currentTimeMillis());
//        System.out.println(IntStream.range(1, 100000000).parallel().filter(PrimeUtil::isPrime).count());
        System.out.println(System.currentTimeMillis());
        //1000+
        //5000+

        //30,474
        //126,611
        int[] array = new int[12];
        Arrays.parallelSort(array);
        Random random = new Random();
        Arrays.setAll(array, (i) -> random.nextInt());
        for (int k = 0; k < array.length; k++) {
            System.out.println(array[k]);
        }
    }
}
